package com.bgs.eat.operationType.controller;

import com.bgs.eat.config.CommonResult;
import com.bgs.eat.operationType.service.OperationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName OperationTypeController
 * @Description TODO
 * @Author lzy
 * @Date 2022/10/17 11:28
 **/
@RestController
@RequestMapping("/operation_type")
@CrossOrigin
public class OperationTypeController {

    @Autowired
    OperationTypeService operationTypeService;

    /**
    * @Description 申请店铺新增时获取 营业类别 信息列表
    * @Author lzy
    * @Date 2022/10/17 11:32
    * @Return com.bgs.eat.config.CommonResult

    */
    @GetMapping("/getOperationList")
    public CommonResult getOperationList() {
        return operationTypeService.getOperationList();
    }

    /**
    * @Author G胖
    * @Description 查询所有的营业类别
    * @Date 2022-10-26 上午 09:30
    * @Return com.bgs.eat.config.CommonResult

    */
    @GetMapping("/getAllOperationList")
    public CommonResult getAllOperationList(){
        return CommonResult.ok(operationTypeService.getAllOperationList());
    }

}
